package com.cake.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.cake.query.OrderQuery;
import com.cake.service.inter.IXxOrderService;

/**
 * 订单控制层
 * @author Administrator
 *
 */
@RestController
@RequestMapping(value = "order")
public class OrderController {

	@Autowired
	private IXxOrderService xxOrderService;
	
	/**
	 * 订单展示首页
	 * @return
	 */
	@PostMapping(value = "selectOrders")
	public Object selectOrders(@RequestBody OrderQuery orderQuery){
		return xxOrderService.selectOrders(orderQuery);
	}
	
	/**
	 * 根据订单主键查询订单详情
	 * @return
	 */
	@GetMapping(value = "selectOrderByOrderId")
	public Object selectOrderByOrderId(@RequestParam(value = "orderId")Long orderId){
		return xxOrderService.selectOrderByOrderId(orderId);
	}
	
}
